package com.blast.cn

import android.app.Application
import androidx.appcompat.app.AppCompatDelegate
import com.tencent.bugly.Bugly
import com.wxl.common.AppContext
import skin.support.SkinCompatManager
import skin.support.app.SkinCardViewInflater
import skin.support.constraint.app.SkinConstraintViewInflater
import skin.support.design.app.SkinMaterialViewInflater
import skin.support.utils.Slog

class App : Application(){

    override fun onCreate() {
        super.onCreate()
        AppContext.appContext.init(this,true)

        // 框架换肤日志打印
        Slog.DEBUG = true
        SkinCompatManager.withoutActivity(this)
            .addInflater(SkinMaterialViewInflater()) // material design
            .addInflater(SkinConstraintViewInflater()) // ConstraintLayout
            .addInflater(SkinCardViewInflater()) // CardView v7
           // .setSkinStatusBarColorEnable(true) // 关闭状态栏换肤
            //                .setSkinWindowBackgroundEnable(false)           // 关闭windowBackground换肤
            //                .setSkinAllActivityEnable(false)                // true: 默认所有的Activity都换肤; false: 只有实现SkinCompatSupportable接口的Activity换肤
            .loadSkin()
        AppCompatDelegate.setCompatVectorFromResourcesEnabled(true)

        Bugly.init(this, "509982778c", false)
    }
}